<?php
require_once 'application/library/controller/gcLBasicAction.php';
require_once 'application/modules/site/services/site_services_siteInfoSetService.php';
require_once 'application/constant/templatName.php';

/**
 * IndexController
 * @author    Soochow University
 * @version   1.0
 * @exclude   作  成  日：2011/04/07
 */
class site_siteInfoSetController extends gcLBasicAction{
    
    private $objService;
    /**
     * indexAction
     * @return 
     */
    public function indexAction(){
        $this->initMenu("4");
        $this->boolUserTypeCheck("4");
        
        $this->objService = new site_services_siteInfoSetService();
        $this->initCkeditor();
        
        $this->gcView->render("siteInfoSet.tpl");
    }
    
    private function initCkeditor() {
        $strCompanyIntroduce    = $this->objService->pbGetSiteInfo("1");
        $strCorporateCulture    = $this->objService->pbGetSiteInfo("2");
        $strDevelopmentStrategy = $this->objService->pbGetSiteInfo("3");
        
        $this->gcView->companyIntroduce = $strCompanyIntroduce;
        $this->gcView->corporateCulture = $strCorporateCulture;
        $this->gcView->developmentStrategy = $strDevelopmentStrategy;
    }
    
    public function saveAction() {
        $strCompanyIntroduce    = $this->getParam("companyIntroduce");
        $strCorporateCulture    = $this->getParam("corporateCulture");
        $strDevelopmentStrategy = $this->getParam("developmentStrategy");
        
        $this->objService = new site_services_siteInfoSetService();
        $this->objService->pbSaveSiteInfo($strCompanyIntroduce, $strCorporateCulture, $strDevelopmentStrategy);
        
        $this->initCkeditor();
        $this->gcView->render("siteInfoSet.tpl");
        
    }
}
